use 5.010;
use strict;
use warnings;

package JasPerl::JSTL::Core::RemoveTag;

use parent qw(JasPerl::TagExt::JspTag);

use JasPerl::PageContext;

sub set_scope {
    $_[0]->{scope} = JasPerl::PageContext->get_scope_by_name($_[1]);
}

sub set_var {
    $_[0]->{var} = $_[1];
}

sub do_tag {
    my $self = shift;
    if (defined $self->{var}) {
        my $context = $self->get_jsp_context();
        $context->remove_attribute($self->{var}, $self->{scope});
    }
}

1;
